From 0eab2f383538be93bd06468178b51774bc1b906e Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 15 Dec 2005 20:42:09 +0100 Subject: [PATCH] Check for existence of VLAPIC before relinquishing it, or a vmx guest can die very early. Signed-off-by: Xin Li --- xen/arch/x86/vmx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/vmx.c b/xen/arch/x86/vmx.c index e8e6f8d0b2..6f087f8094 100644 --- a/xen/arch/x86/vmx.c +++ b/xen/arch/x86/vmx.c @@ -110,12 +110,12 @@ void vmx_relinquish_resources(struct vcpu *v) vpit = &v->domain->arch.vmx_platform.vmx_pit; if ( active_ac_timer(&(vpit->pit_timer)) ) rem_ac_timer(&vpit->pit_timer); - if ( active_ac_timer(&v->arch.arch_vmx.hlt_timer) ) { + if ( active_ac_timer(&v->arch.arch_vmx.hlt_timer) ) rem_ac_timer(&v->arch.arch_vmx.hlt_timer); - } - if ( vmx_apic_support(v->domain) ) { - rem_ac_timer( &(VLAPIC(v)->vlapic_timer) ); - xfree( VLAPIC(v) ); + if ( vmx_apic_support(v->domain) && (VLAPIC(v) != NULL) ) + { + rem_ac_timer(&VLAPIC(v)->vlapic_timer); + xfree(VLAPIC(v)); } } -- 2.30.2